<!DOCTYPE html>
<html lang="en">

<head>
<meta charset="utf-8">
<meta name="viewport"
	content="width=device-width, initial-scale=1.0, maximum-scale=1.0">

<title>ChargeStation</title>
<meta name="keywords" content="ChargeStation管理系統">
<meta name="description" content="ChargeStation管理系統">
<link href="/css/bootstrap.min.css" rel="stylesheet">
<link href="/css/font-awesome.css?v=4.4.0" rel="stylesheet">
<link href="/css/animate.css" rel="stylesheet">
<link href="/css/style.css" rel="stylesheet">
<link href="/css/login.css" rel="stylesheet">
<link href="/css/plugins/iCheck/custom.css" rel="stylesheet">
<!--[if lt IE 9]>
    <meta http-equiv="refresh" content="0;ie.html" />
    <![endif]-->
<script>
	if (window.top !== window.self) {
		window.top.location = window.location;
	}
</script>

</head>

<body class="signin">
	<div class="signinpanel">
		<div class="row">
			<div class="col-sm-3">
			</div> 
			<div class="col-sm-6">
				<form id="signupForm">
					<h3 class="text-center">找回密码</h3>
					<p class="m-t-md text-center">欢迎使用IOT管理平台</p>
					<div class="form-group">
						<input type="text" name="username" class="form-control uname" value="" placeholder="手机号/邮箱"/> 
		            </div>
		           <div class="form-group" style="display:inline-block;width:100%;">
		                <div style="width: 80%;float: left;">
		                    <input class="form-control" type="text" name="verifyCodeActual" placeholder="验证码" >
		                </div>
		                <div style="width: 20%;float: left;margin-top:13px;">
		                    <img src="/kaptcha" id="kaptcha" width="100%" height="100%"/>
		                </div>
		            </div>
		            <div class="form-group">
						<button class="btn btn-login btn-block">找回密码</button>
		            </div>
					<!--按钮模块-->
					<div class="outside-login">
                    <div class="outside-login-tit">
                        <span></span>
                    </div>
                    <div class="outside-login-cot">
                        <a class="outside-login-btn wxoa actived  J-btnSwitchLoginType" target="_self"
                           href="/login.html">
                            <span style="color: #1AE66B;">重新登录</span>
                        </a>
                    </div>
                </div>
				</form>
			</div>
			<div class="col-sm-3">
			</div> 
		</div>
		<div class="signup-footer">
			<div class="pull-left">&copy; 2018 All Rights Reserved. ChargeStation
			</div>
		</div>
	</div>
	<!-- 全局js -->
	<script src="/js/jquery.min.js?v=2.1.4"></script>
	<script src="/js/bootstrap.min.js?v=3.3.6"></script>

	<!-- 自定义js -->
	<script src="/js/content.js?v=1.0.0"></script>

	<!-- jQuery Validation plugin javascript-->
	<script src="/js/plugins/validate/jquery.validate.min.js"></script>
	<script src="/js/plugins/validate/messages_zh.min.js"></script>
	<script src="/js/plugins/layer/layer.min.js"></script>
	<script src="/js/plugins/iCheck/icheck.min.js"></script>
    <script>
        $(document).ready(function(){$(".i-checks").iCheck({checkboxClass:"icheckbox_square-green",radioClass:"iradio_square-green",})});
    </script>
	<script type="text/javascript">
		$(document).ready(function() {
			validateRule();
			//$("#signupForm").validate();
		});
		$.validator.setDefaults({
			submitHandler : function() {
				login();
			}
		});

		function login() {
			$.ajax({
				type : "POST",
				url : "/login",
				data : $('#signupForm').serialize(),
				success : function(r) {
					if (r.code == 0) {
						parent.location.href = '/index';
					} else {
						layer.msg(r.msg);
					}
				}
			});
		}

		function validateRule() {
			var icon = "<i class='fa fa-times-circle'></i> ";
			$("#signupForm").validate({
				rules : {
					username : {
						required : true
					},
					password : {
						required : true
					}
				},
				messages : {
					username : {
						required : icon + "请输入您的用户名",
					},
					password : {
						required : icon + "请输入您的密码",
					}
				}
			})
		}
		
		  $(function () {
		        $("#kaptcha").on('click', function () {
		            $("#kaptcha").attr('src', '/kaptcha?' + Math.floor(Math.random() * 100)).fadeIn();
		        });
		    });
	</script>
</body>




</html>
